package java0106;

public class Java03 {
    public static void main(String[] args) {

        //字符串类
        //了解：字符串的底层本质是字符数组char[]
         String s1="abcde";
        System.out.println(s1);


        //相等
     boolean a ="abc".equals("abcd");
        System.out.println(a);

        //查找
        int b = "abcde".indexOf("cd");
        System.out.println(b);

        //截取
        String c = "abcde".substring(1, 3);
        System.out.println(c);

        //长度
        int d = "abcde".length();
        System.out.println(d);

        //去除两边空格的方法
        String e = "   abc    ".trim();
        System.out.println(e);

        //替换
        String f = "abc123abc123".replace("123", "张三");
        System.out.println(f);

        //根据下标获取字符
        char g = "abcde".charAt(0);
        System.out.println(g);
    }
}
